<meta http-equiv="content-type" content="text/html" charset="UTF-8">

<script type="text/javascript" src="../../js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../js/layui/layui.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>

<link rel="stylesheet" type="text/css" href="../../js//layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="../../css/bingAdmin.css">
<link rel="stylesheet" type="text/css" href="../../css/view/commonEdit.css">

<style>
.layui-input-block{
  width: 329px;
}
</style>
<div class="wrap">
  <form class="layui-form layui-form-pane" action="">
    <div class="layui-form-item">
      <label class="layui-form-label">状态</label>
      <div class="layui-input-inline">
        <select name="status" lay-filter="status">
          <option value="">全部</option>
          <option value="1">使用中</option>
          <option value="0">未使用</option>
        </select>
      </div>
    </div>
    
    <div class="layui-form-item" style="margin-top:65px;padding-left:23px;">
      <button class="layui-btn" lay-submit="" lay-filter="save">筛选</button>
      <button class="layui-btn layui-btn-warm" type="reset" >重置</button>
      <button class="layui-btn layui-btn-primary" id="cancel">取消</button>
    </div>
  </form>
  
  
</div>
<script>
var access_token = sessionStorage.access_token;
var userId = sessionStorage.userid;

layui.use(['form'], function(){
  var form = layui.form;
  //获取数据
  var filterData = parent.filterData;
  $('select[name="status"]').val(filterData.status);
  
  form.render();
  
  //保存编辑按钮点击事件
  form.on('submit(save)', function(data){
    parent.filterData = {
      'status':data.field.status
    };
    parent.tableRef = true;
    parent.layer.msg("筛选成功");
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭   
    
    return false;
  });
  //取消按钮点击事件
  $('#cancel').click(function(){
    //当你在iframe页面关闭自身时
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭   
  });

  
});



</script>